<!DOCTYPE html>

<html>

    <head>

        <meta charset="utf-8">

        <title>

            密码修改

        </title>

        <meta name="renderer" content="webkit">

        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

        <meta name="apple-mobile-web-app-status-bar-style" content="black">

        <meta name="apple-mobile-web-app-capable" content="yes">

        <meta name="format-detection" content="telephone=no">

        <link href="__PUBLIC__/skin/nei.css" type="text/css" rel="stylesheet">         

    </head>

</head>

<body onLoad="initPage()">

<div id="LoadingBar"><img src="__PUBLIC__/images/load.gif" /></div>

<div class="contaiter">   

  <form class="layui-form layui-form-pane">  

      <div class="layui-form-item">

        <label class="layui-form-label">账号</label>

        <div class="layui-input-inline">

          <input type="text" name="name" value="{$name}" disabled placeholder="请输入" autocomplete="off" readonly class="layui-input">

        </div>

      </div>  
      <div class="layui-form-item">

        <label class="layui-form-label">新密码</label>

        <div class="layui-input-inline">

          <input type="password" name="pass2" id="pass2" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">

        </div>

        <div class="layui-form-mid layui-word-aux">请输入新密码</div>

      </div>     

      <div class="layui-form-item">

        <button class="layui-btn layui-btn-green" lay-submit=""  lay-filter="go" >修改密码</button>

      </div>

    </form> 

</div>  

<script src="__PUBLIC__/js/jquery-1.10.2.min.js" type="application/javascript"></script>

<script src="__PUBLIC__/js/neijqtab.js" type="application/javascript"></script>

<script src="__PUBLIC__/js/layui/layui.js" charset="utf-8"></script>

<script>

function initPage(){   

  var objLoading = document.getElementById("LoadingBar");   

  if (objLoading != null){   

    objLoading.style.display = "none";   

    $(".contaiter").css("display","block");

  }   

}  

</script>

<script>

  layui.use(['form'], function(){

    var form = layui.form()

    ,layer = layui.layer

    //监听提交

    form.on('submit(go)', function(data){

        var loading2 = layer.load();  

        $.ajax({

            url:'__ROOT__/admin/admin/editpass',

            type:"POST",

            data:{name:data.field.name,pass2:data.field.pass2},

            dataType:"",

            success:function(json){
              layer.close(loading2);
              if(json==1){      
                  var index = parent.layer.getFrameIndex(window.name); 
                  parent.layer.close(index);
              }else{

                 layer.alert("您的旧密码错误，请重新输入！",{time:1000});  

              }

            },

            error:function(res){

              alert("AJAX错误");

            }

        });

        return false;

    });

    

    

  });

</script>

</body>

</html>

